package com.tarry.observer;

/**
 *
 */
public class StudentObserver implements Observer {

    private Subject subject;
    private String name;

    public StudentObserver(){}
    public StudentObserver(Subject subject,String name){
        this.subject = subject;
        this.name = name;
        this.subject.addObserver(this);
    }

    @Override
    public void update(String info) {
        System.out.println(name + "，今天的作业是："+info);
    }
}
